Question: Let
\[f(x) = \frac{ax}{x + 1}.\]Find the constant $a$ so that $f(f(x)) = x$ for all $x \neq -1.$
Solution: We have that
\begin{align*}
f(f(x)) &= f \left( \frac{ax}{x + 1} \right) \\
&= \frac{a \cdot \frac{ax}{x + 1}}{\frac{ax}{x + 1} + 1} \\
&= \frac{a^2 x}{ax + x + 1}.
\end{align*}We want
\[\frac{a^2 x}{ax + x + 1} = x\]for $x \neq -1.$  This gives us
\[a^2 x = ax^2 + x^2 + x.\]Matching the coefficients, we get $a^2 = 1$ and $a + 1 = 0.$  Thus, $a = \boxed{-1}.$